package com.hzncc.flowable_diboot.contract.vo;

import com.diboot.core.binding.annotation.BindDict;
import com.diboot.core.binding.annotation.BindEntity;
import com.diboot.core.binding.annotation.BindField;
import com.diboot.core.entity.BaseModel;
import com.diboot.iam.entity.IamUser;
import com.hzncc.flowable_diboot.contract.entity.SalesContract;
import com.hzncc.flowable_diboot.contract.entity.SalesContractExt;
import com.hzncc.flowable_diboot.entity.SapCustomer;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

@Getter
@Setter
@Accessors(chain = true)
public class SalesContractVO extends BaseModel {

    /**
     * 采购订单编号（合同号）
     */
    private String orderCode;

    /**
     * 合同类型
     */
    private String contractType;

    /**
     * 送达方（合同签订单位）
     */
    private String recipient;

    /**
     * 合同签订单位名称
     */
    @BindField(entity = SapCustomer.class,
            field = "name",
            condition = "this.recipient = id")
    private String recipientLabel;

    /**
     * 销售区域
     */
    private String salesTerritory;

    /**
     * 销售区域
     */
    @BindDict(type = "salesArea",
            field = "salesTerritory")
    private String salesTerritoryLabel;

    /**
     * 业务板块
     */
    private String businessModel;

    @BindDict(type = "contractBusinessModel",
        field = "businessModelLabel")
    private String businessModelLabel;

    /**
     * 业务部门
     */
    private String businessDept;

    /**
     * 订购项目（项目内容）
     */
    private String orderItem;

    /**
     * 订购型号
     */
    private String orderModel;

    /**
     * 订单日期
     */
    private LocalDateTime orderDate;

    /**
     * 合同交货日期
     */
    private String deliveryTime;

    @BindDict(type = "deliveryTimeOfTheSalesContract",field = "deliveryTime")
    private String deliveryTimeLabel;

    @BindEntity(entity = SalesContractExt.class,condition = "this.id = sales_contract_id",deepBind = true)
    private SalesContractExtVO salesContractExtVO;

}
